fix: stop GitHub from evaluating example expressions in action.yml#11
Merged
Conversation
GitHub's runner evaluates `${{ ... }}` tokens that appear anywhere in
`action.yml` — including inside `description:` blocks — when it loads
the action manifest. Embedding `${{ github.sha }}` and
`${{ secrets.OPENAI_API_KEY }}` literally as documentation examples
caused every workflow that referenced this action to fail at load time
with `Unrecognized named-value: 'github'` and `'secrets'`.
Replace the four offending example tokens with placeholders that don't
resemble Actions expressions:
- `tags` example: `commit: ${{ github.sha }}` → `commit: <commit-sha>`
- `branch` description: ``Defaults to `${{ github.ref_name }}`.`` →
``Defaults to the `GITHUB_REF_NAME` environment variable.``
- `commit-sha` description: same treatment with `GITHUB_SHA`.
- `secrets` example: `KEY=${{ secrets.* }}` → `KEY=<placeholder>`.
Real workflow examples in README.md and examples/ are unaffected
because expressions inside workflow files are evaluated normally.
There was a problem hiding this comment.
Pull request overview
Fixes a GitHub Actions manifest load-time failure caused by ${{ ... }} tokens embedded in action.yml input description examples (which GitHub evaluates while parsing the action manifest, before runtime contexts like github/secrets exist).
Changes:
- Replaced
${{ github.* }}example tokens in input descriptions with non-expression placeholders / environment variable references. - Replaced
${{ secrets.* }}example tokens with placeholder values to prevent manifest parsing errors.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every workflow that tries to use this action currently fails at load time with errors like:
```
Error: spicehq/spice-cloud-deploy-action//action.yml (Line: 43, Col: 18): Unrecognized named-value: 'github'. Located at position 1 within expression: github.sha
Error: ... Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.OPENAI_API_KEY
Error: Failed to load spicehq/spice-cloud-deploy-action//action.yml
```
GitHub's runner evaluates `${{ ... }}` expressions that appear anywhere in `action.yml` — including inside `description:` blocks — when it loads the manifest. The `tags`, `branch`, `commit-sha`, and `secrets` input descriptions had literal `${{ github.sha }}` / `${{ github.ref_name }}` / `${{ secrets.* }}` tokens as documentation examples, and there's no `github`/`secrets` context at action-load time, so the runner errors out before the action even starts.
Fix
Replace the four offending example tokens with placeholders that don't look like Actions expressions:
Real workflow examples in `README.md` and `examples/` are unaffected — expressions inside workflow files (consumer-side) are evaluated normally; the bug only existed in the action's own manifest.
Test plan
Severity
This is a release blocker — the v1.0.0 tag cannot be cut on top of `f84b3ab` because every consumer immediately hits the load error. Recommend merging and then re-tagging `v1.0.0` from the post-merge commit.